import { defineConfig } from "plasmo"

export default defineConfig({
  manifest: {
    permissions: [
      "storage",
      "https://*/*",
      "http://*/*",
      "blob:",
      "tabs",
      "activeTab",
      "scripting"
    ],
    content_scripts: [
      {
        matches: ["<all_urls>"],
        js: ["content.ts"],
        run_at: "document_end"
      }
    ]
  },
  "background": {
    "service_worker": "background.ts",
    "type": "module"
  },
  babel: {
    plugins: [
      [
        "import",
        {
          libraryName: "antd",
          libraryDirectory: "es",
          style: true // 自动加载 LESS 样式
        }
      ]
    ],
    presets: [
      [
        "@babel/preset-react",
        {
          throwIfNamespace: false // 允许 JSX 命名空间
        }
      ]
    ]
  }
})